<?php
// 本类由系统自动生成，仅供测试用途
namespace Admin\Controller;

class ModelsController extends LoginController {
	public $re_url = '/admin/WebSet/index';
	public function __construct() {
		parent::__construct ();
		layout ( false );
	}
	
	// 模型管理
	public function model() {
		$this->db = D ( "Moxing" );
		if ($_POST) {
			$this->checkToken($_POST);
			$arr = $_POST;
			if ($arr ['id']) {
				$this->db->where ( "id=" . $arr ['id'] )->save ( $arr );
			} else {
				$this->db->add ( $arr );
			}
			S ( 'modelinfo', null );
		}
		
		$data = $this->db->getModel ();
		$this->assign ( "data", $data ); // 模型列表数据
		$this->display ( 'model' );
	}
}